package redlib.backend.dao;

import org.apache.ibatis.annotations.Param;
import redlib.backend.dto.query.ArticleQueryDTO;
import redlib.backend.model.Article;

import java.util.ArrayList;
import java.util.List;

public interface ArticleMapper {

    int insert(Article record);


    Article selectByPrimaryKey(Integer id);



    int updateByPrimaryKey(Article record);


    Integer count(ArticleQueryDTO queryDTO);

    List<Article> list(@Param("queryDTO") ArticleQueryDTO queryDTO, @Param("offset") Integer offset, @Param("limit") Integer limit
    );

    void deleteByCodes(@Param("codeList") List<Integer> codeList);

   Article getByTitle(
            @Param("title") String title);

    List<Article> listByIds(@Param("ids") List<Integer> ids);



}